*Replication file -- FB comment analysis

use "/Users/nathankalmoe/Dropbox/Research/A Publishing/Finished/PoP - Facebook Protests/FB Data Merged - Manual Finish - anonymized.dta", clear
set more off

*** ANALYSIS ***

*Table 2 - Comments
tab killjustagree 
tab killjustagree if local==1
tab killjustagree if louisiana==1 & local==0

tab policeagree
tab policeagree if local==1
tab policeagree if louisiana==1 & local==0

tab protestagree
tab protestagree if local==1
tab protestagree if louisiana==1 & local==0

tab forceagree
tab forceagree if local==1
tab forceagree if louisiana==1 & local==0

tab equalityagree
tab equalityagree if local==1
tab equalityagree if louisiana==1 & local==0

tab newsviewagree
tab newsviewagree if local==1
tab newsviewagree if louisiana==1 & local==0

*Analysis described in the text (excluding "no indication" fro denominator)
tab protestagree if local==1 & protestagree~=0
tab protestagree if louisiana==1 & protestagree~=0

tab policeagree if local==1 & policeagree~=0
tab policeagree if louisiana==1 & policeagree~=0

tab forceagree if local==1 & forceagree~=0
tab forceagree if louisiana==1 & forceagree~=0

tab killjustagree if local==1 & killjustagree~=0
tab killjustagree if louisiana==1 & killjustagree~=0

tab newsviewagree if local==1 & newsviewagree~=0
tab newsviewagree if louisiana==1 & newsviewagree~=0

tab equalityagree if local==1 & equalityagree~=0
tab equalityagree if louisiana==1 & equalityagree~=0

*Table 3 - Comments by Race
tab killjustagree if local==1 & black==1 & killjustagree~=0
tab killjustagree if local==1 & white==1 & killjustagree~=0

tab policeagree if local==1 & black==1 & policeagree~=0
tab policeagree if local==1 & white==1 & policeagree~=0

tab protestagree if local==1 & black==1 & protestagree~=0
tab protestagree if local==1 & white==1 & protestagree~=0

tab forceagree if local==1 & black==1 & forceagree~=0
tab forceagree if local==1 & white==1 & forceagree~=0

tab equalityagree if local==1 & black==1 & equalityagree~=0
tab equalityagree if local==1 & white==1 & equalityagree~=0

tab newsviewagree if local==1 & black==1 & newsviewagree~=0
tab newsviewagree if local==1 & white==1 & newsviewagree~=0


*Table 4 - Contentious Comments
*All
su violanyagree violprotagree violpolagree violreplyagree insultagree moreforceagree justkillagree
su peaceagree nonviolagree lessforceagree unjustkillagree
su negraceanyagree negraceblkagree negracewhtagree negracebothagree

*Black
su violanyagree violprotagree violpolagree violreplyagree insultagree moreforceagree justkillagree if black==1
su peaceagree nonviolagree lessforceagree unjustkillagree if black==1
su negraceanyagree negraceblkagree negracewhtagree negracebothagree if black==1

*White
su violanyagree violprotagree violpolagree violreplyagree insultagree moreforceagree justkillagree if white==1
su peaceagree nonviolagree lessforceagree unjustkillagree if white==1
su negraceanyagree negraceblkagree negracewhtagree negracebothagree if white==1

*Significance tests
reg violanyagree black if black==1|white==1, cluster(fbid)
reg violprotagree black if black==1|white==1, cluster(fbid)
reg violpolagree black if black==1|white==1, cluster(fbid)
reg violreplyagree black if black==1|white==1, cluster(fbid)
reg insultagree black if black==1|white==1, cluster(fbid)
reg moreforceagree black if black==1|white==1, cluster(fbid)
reg justkillagree black if black==1|white==1, cluster(fbid)

reg peaceagree black if black==1|white==1, cluster(fbid)
reg nonviolagree black if black==1|white==1, cluster(fbid)
reg lessforceagree black if black==1|white==1, cluster(fbid)
reg unjustkillagree black if black==1|white==1, cluster(fbid)

reg negraceanyagree black if black==1|white==1, cluster(fbid)
reg negraceblkagree black if black==1|white==1, cluster(fbid)
reg negracewhtagree black if black==1|white==1, cluster(fbid)
reg negracebothagree black if black==1|white==1, cluster(fbid)

*Table 5 - Predicting Contentiousness
*Recoding to change proportions into percentages
gen violanyagree100=violanyagree*100
gen violprotagree100=violprotagree*100
gen violpolagree100=violpolagree*100
gen violreplyagree100=violreplyagree*100

gen insultagree100=insultagree*100
gen moreforceagree100=moreforceagree*100
gen justkillagree100=justkillagree*100

gen peaceagree100=peaceagree*100
gen nonviolagree100=nonviolagree*100
gen lessforceagree100=lessforceagree*100
gen unjustkillagree100=unjustkillagree*100

gen negraceanyagree100=negraceanyagree*100
gen negraceblkagree100=negraceblkagree*100
gen negracewhtagree100=negracewhtagree*100
gen negracebothagree100=negracebothagree*100

*Results by Race 
*Black
reg violanyagree100 fem college married local christian lengthlog insultagree killjustagree negraceblkagree negracewhtagree negracebothagree if black==1, cluster(fbid)
reg violprotagree100 fem college married local christian lengthlog insultagree killjustagree negraceblkagree negracewhtagree negracebothagree if black==1, cluster(fbid)
reg violpolagree100 fem college married local christian lengthlog insultagree killjustagree negraceblkagree negracewhtagree negracebothagree if black==1, cluster(fbid)
reg violreplyagree100 fem college married local christian lengthlog insultagree killjustagree negraceblkagree negracewhtagree negracebothagree if black==1, cluster(fbid)
reg insultagree100 fem college married local christian lengthlog killjustagree if black==1, cluster(fbid)
reg moreforceagree100 fem college married local christian lengthlog insultagree killjustagree negraceblkagree negracewhtagree negracebothagree if black==1, cluster(fbid)
reg justkillagree100 fem college married local christian lengthlog insultagree negraceblkagree negracewhtagree negracebothagree if black==1, cluster(fbid)

*White
reg violanyagree100 fem college married local christian lengthlog insultagree killjustagree negraceblkagree negracewhtagree negracebothagree if white==1, cluster(fbid)
reg violprotagree100 fem college married local christian lengthlog insultagree killjustagree negraceblkagree negracewhtagree negracebothagree if white==1, cluster(fbid)
reg violpolagree100 fem college married local christian lengthlog insultagree killjustagree negraceblkagree negracewhtagree negracebothagree if white==1, cluster(fbid)
reg violreplyagree100 fem college married local christian lengthlog insultagree killjustagree negraceblkagree negracewhtagree negracebothagree if white==1, cluster(fbid)
reg insultagree100 fem college married local christian lengthlog killjustagree if white==1, cluster(fbid)
reg moreforceagree100 fem college married local christian lengthlog insultagree killjustagree negraceblkagree negracewhtagree negracebothagree if white==1, cluster(fbid)
reg justkillagree100 fem college married local christian lengthlog insultagree negraceblkagree negracewhtagree negracebothagree if white==1, cluster(fbid)


*Results for everyone, reported in the appendix
reg violanyagree100 white black fem college married local christian lengthlog insultagree killjustagree negraceblkagree negracewhtagree negracebothagree, cluster(fbid)
reg violprotagree100 white black fem college married local christian lengthlog insultagree killjustagree negraceblkagree negracewhtagree negracebothagree, cluster(fbid)
reg violpolagree100 white black fem college married local christian lengthlog insultagree killjustagree negraceblkagree negracewhtagree negracebothagree, cluster(fbid)
reg violreplyagree100 white black fem college married local christian lengthlog insultagree killjustagree negraceblkagree negracewhtagree negracebothagree, cluster(fbid)

reg insultagree100 white black fem college married local christian lengthlog killjustagree, cluster(fbid)
reg moreforceagree100 white black fem college married local christian lengthlog insultagree killjustagree negraceblkagree negracewhtagree negracebothagree, cluster(fbid)
reg justkillagree100 white black fem college married local christian lengthlog insultagree negraceblkagree negracewhtagree negracebothagree, cluster(fbid)

*Table 6 by Race
*Black
reg peaceagree100 fem college married local christian lengthlog insultagree killjustagree negraceblkagree negracewhtagree negracebothagree if black==1, cluster(fbid)
reg nonviolagree100 fem college married local christian lengthlog insultagree killjustagree negraceblkagree negracewhtagree negracebothagree if black==1, cluster(fbid)
reg lessforceagree100 fem college married local christian lengthlog insultagree negraceblkagree negracewhtagree negracebothagree if black==1, cluster(fbid)
reg unjustkillagree100 fem college married local christian lengthlog insultagree negraceblkagree negracewhtagree negracebothagree if black==1, cluster(fbid)
*White
reg peaceagree100 fem college married local christian lengthlog insultagree killjustagree negraceblkagree negracewhtagree negracebothagree if white==1, cluster(fbid)
reg nonviolagree100 fem college married local christian lengthlog insultagree killjustagree negraceblkagree negracewhtagree negracebothagree if white==1, cluster(fbid)
reg lessforceagree100 fem college married local christian lengthlog insultagree negraceblkagree negracewhtagree negracebothagree if white==1, cluster(fbid)
reg unjustkillagree100 fem college married local christian lengthlog insultagree negraceblkagree negracewhtagree negracebothagree if white==1, cluster(fbid)

*All, reported in appendix
reg peaceagree100 white black fem college married local christian lengthlog insultagree killjustagree negraceblkagree negracewhtagree negracebothagree, cluster(fbid)
reg nonviolagree100 white black fem college married local christian lengthlog insultagree killjustagree negraceblkagree negracewhtagree negracebothagree, cluster(fbid)
reg lessforceagree100 white black fem college married local christian lengthlog insultagree killjustagree negraceblkagree negracewhtagree negracebothagree, cluster(fbid)
reg unjustkillagree100 white black fem college married local christian lengthlog insultagree negraceblkagree negracewhtagree negracebothagree, cluster(fbid)

*Table 7 by Race
*Black
reg negraceanyagree100 fem college married local christian lengthlog killjustagree if black==1, cluster(fbid)
reg negraceblkagree100 fem college married local christian lengthlog killjustagree if black==1, cluster(fbid)
reg negracewhtagree100 fem college married local christian lengthlog killjustagree if black==1, cluster(fbid)
reg negracebothagree100 fem college married local christian lengthlog killjustagree if black==1, cluster(fbid)
*White
reg negraceanyagree100 fem college married local christian lengthlog killjustagree if white==1, cluster(fbid)
reg negraceblkagree100 fem college married local christian lengthlog killjustagree if white==1, cluster(fbid)
reg negracewhtagree100 fem college married local christian lengthlog killjustagree if white==1, cluster(fbid)
reg negracebothagree100 fem college married local christian lengthlog killjustagree if white==1, cluster(fbid)

*All, reported in appendix
reg negraceanyagree100 white black fem college married local christian lengthlog killjustagree, cluster(fbid)
reg negraceblkagree100 white black fem college married local christian lengthlog killjustagree, cluster(fbid)
reg negracewhtagree100 white black fem college married local christian lengthlog killjustagree, cluster(fbid)
reg negracebothagree100 white black fem college married local christian lengthlog killjustagree, cluster(fbid)


*Table 8
*All
reg likes white black fem college married local lengthlog violprotagree violpolagree violreplyagree insultagree moreforceagree justkillagree peaceagree nonviolagree lessforceagree unjustkillagree negraceblkagree negracewhtagree negracebothagree, cluster(fbid)
vif
*Black
reg likes fem college married local lengthlog violprotagree violpolagree violreplyagree insultagree moreforceagree justkillagree peaceagree nonviolagree lessforceagree unjustkillagree negraceblkagree negracewhtagree negracebothagree if black==1, cluster(fbid)
vif
*White
reg likes fem college married local lengthlog violprotagree violpolagree violreplyagree insultagree moreforceagree justkillagree peaceagree nonviolagree lessforceagree unjustkillagree negraceblkagree negracewhtagree negracebothagree if white==1, cluster(fbid)
vif

